package com.oocl.euc.common.utils;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

public class FileUtil {

    private static Logger logger = LoggerFactory.getLogger(FileUtil.class);

    private FileUtil() {
    }

    public static File writeByteToFile(String filePath, String fileName, byte[] content) {
        File file = null;
        try {
            file = new File(filePath, fileName);
            FileUtils.writeByteArrayToFile(file, content);
        } catch (Exception e) {
            logger.error("error", e);
        }
        return file;
    }
}
